package com.tledu.production.service.device.impl;

import com.tledu.production.mapper.device.DeviceTypeMapper;
import com.tledu.production.model.device.DeviceType;
import com.tledu.production.service.device.DeviceTypeService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;


@AllArgsConstructor
@Service
public class DeviceTypeServiceImpl implements DeviceTypeService {

    private final DeviceTypeMapper deviceTypeMapper;

    //分页
    @Override
    public List<DeviceType> list() {
        return deviceTypeMapper.list();
    }


    //添加
    @Override
    public int insert(DeviceType deviceType) {
        return deviceTypeMapper.insert(deviceType);
    }


    //更新
    @Override
    public int update(DeviceType deviceType) {
        return deviceTypeMapper.update(deviceType);
    }

    //根据id查询
    @Override
    public DeviceType findById(String deviceTypeId) {
        return deviceTypeMapper.findById(deviceTypeId);
    }

    //删除
    @Override
    public int delete(String deviceTypeId){
        return deviceTypeMapper.delete(deviceTypeId);
    }


    //根据不同字段搜索
    @Override
    public List<DeviceType> search(String type, String searchText) {
        return deviceTypeMapper.search(type, searchText);
    }
}
